package edu.tsinghua.mrpvc.device.rfid;


//import java.util.Dictionary;
//import java.util.Hashtable;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

//import edu.tsinghua.mrpvc.device.RFIDDetect;
//import edu.tsinghua.mrpvc.simulate.util.SimulateTopic;


//import org.osgi.service.event.Event;
//import org.osgi.service.event.EventConstants;
//import org.osgi.service.event.EventHandler;


public class Activator implements BundleActivator{
	
	//private static String[] RFID_RESPONSE_TOPICS = new String[]{RFIDDetect.EVENT_TOPIC_ISVALID};
	//private static String[] SIMULATE_RFID_TOPICS = new String[]{SimulateTopic.RFID_DETECT,
	//															SimulateTopic.RFID_VISIT,
	//														SimulateTopic.RFID_LEAVE};
	//private RFIDDetectImpl RFIDImpl;

	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		
//		RFIDImpl = new RFIDDetectImpl(context);
//		context.registerService(RFIDDetect.class.getName(), RFIDImpl, null);
//		
//		Dictionary<String, Object> rfidResonse = new Hashtable<String, Object>();
//		rfidResonse.put(EventConstants.EVENT_TOPIC, RFID_RESPONSE_TOPICS);
//		context.registerService(EventHandler.class.getName(), RFIDImpl, rfidResonse);
		/*
		Dictionary<String, Object> simulateRfidResonse = new Hashtable<String, Object>();
		simulateRfidResonse.put(EventConstants.EVENT_TOPIC, SIMULATE_RFID_TOPICS);
		context.registerService(EventHandler.class.getName(), this, simulateRfidResonse);
		//context.registerService(EventHandler.class.getName(), service, properties)
		 */
	}

	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
	}

	//@Override
	//public void handleEvent(Event event) {
		// TODO Auto-generated method stub
		/*
		if(event.getTopic().equals(SimulateTopic.RFID_DETECT)){
			RFIDImpl.detect();
		}
		else if(event.getTopic().equals(SimulateTopic.RFID_VISIT)){
			RFIDImpl.visit();
		}
		else if(event.getTopic().equals(SimulateTopic.RFID_LEAVE)){
			RFIDImpl.leave();
		}
		*/
	//}

}
